# This is a sample Python script.
from flask import Flask
from bank import login
# import index
import featureExtractionResnet50
import picInterfaceResnet50
import milvus_test

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
app = Flask(__name__)


@app.route("/test3")
def print_hi():
    # Use a breakpoint in the code line below to debug your script. # Press Ctrl+F8 to toggle the breakpoint.
    return "hello word"


@app.route("/login", methods=['POST'])
def login1():

    # Use a breakpoint in the code line below to debug your script. # Press Ctrl+F8 to toggle the breakpoint.
    return login.login()

#  特征提取，提取数据集特征
@app.route("/preloadingPic", methods=['POST'])
def preloadingPic():
    # Use a breakpoint in the code line below to debug your script. # Press Ctrl+F8 to toggle the breakpoint.
    return featureExtractionResnet50.splitData()


# 搜索图片
@app.route("/search", methods=['POST'])
def get_similar_images():
    # Use a breakpoint in the code line below to debug your script. # Press Ctrl+F8 to toggle the breakpoint.
    return picInterfaceResnet50.get_similar_images()

# 搜索图片
# @app.route("/milvusTest", methods=['POST'])
# def get_similar_images():
#     milvus.milvusTest()

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    app.run(host="127.0.0.1",port=8081)

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
